package com.market.category.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.market.category.domain.CategoryCommand;


public class CategoryValidator implements Validator{
	@Override
	public boolean supports(Class<?> clazz) {
		return CategoryCommand.class.isAssignableFrom(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "category", "required");		
	}
	
}
